Skip to content

Conversation

@ColeMurray
Copy link
Contributor

Summary

  • Adds validation for schema names to prevent SQL injection vulnerabilities
  • Replaces dynamic SQL string construction with SQLAlchemy's CreateSchema construct
  • Adds comprehensive tests for schema name validation

Changes

  • Added _validate_schema_name() method that checks schema names against a safe character pattern
  • Replaced text() with CreateSchema() for safe schema creation
  • Added tests covering valid schema names and malicious input attempts

Test Plan

  • New unit tests verify that valid schema names are accepted
  • Tests confirm that potentially malicious inputs are rejected
  • Existing schema creation tests updated to use new construct

Adds validation to prevent SQL injection in schema name handling by:
- Validating schema names against safe character set (alphanumeric + underscore)
- Replacing string interpolation with SQLAlchemy's CreateSchema construct
- Adding tests to verify validation and prevent injection attempts
@dosubot dosubot bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Nov 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M This PR changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant